<%@ page import="java.util.ArrayList" %>
<%@ page import="com.jr.pojo.ProjectInfo" %><%--
  Created by IntelliJ IDEA.
  User: 86139
  Date: 2025/8/27
  Time: 20:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<% ArrayList<ProjectInfo>  list =  (ArrayList<ProjectInfo>) session.getAttribute("list");   %>

<form action="/project/projectinfo/query" method="get">
    申报状态<select name="status" >
    <option value="-1">全部</option>
    <option value="0">已申报</option>
    <option value="1">审核中</option>
    <option value="2">已审核</option>
    </select>
    <input type="submit" value="查询">
</form>
<table>
    <caption>申请项目表</caption>
    <tr>
        <th>项目编号</th>
        <th>项目名称</th>
        <th>项目开始时间</th>
        <th>项目结束时间</th>
        <th>状态</th>
        <th>操作</th>
    </tr>

    <% for (ProjectInfo pro:list) {%>
    <tr>
        <td><%=pro.getPid()%></td>
        <td><%=pro.getPname()%></td>
        <td><%=pro.getStartdate()%></td>
        <td><%=pro.getEnddate()%></td>
        <td><%=getStatus(pro.getStatus())%></td>
        <td>
            <%if(pro.getStatus()==0){%>
                 <a href="/project/projectinfo/queryById?pid=<%=pro.getPid()%>">审核</a>
           <% }%>
        </td>
        <%}%>
    </tr>
    <tr>
        <td colspan="6">
            <% String mess = (String )session.getAttribute("mess");%>
            <%if(mess!=null){%>
            <b style="color: chartreuse"><%=mess%></b>
            <%}
            %>
        </td>
    </tr>
</table>
<%!
public String getStatus(int status){
    if (status==0){
        return  "已申报";
    }else if(status==1){
        return "审核中";
    }else{
        return "已审核";
    }
}
%>
</body>
</html>
